package com.xms.security.service.dataauth;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xms.core.enums.AccessRightValue;
import com.xms.security.data.RoleEntityPermissionMapper;
import com.xms.security.entity.RoleEntityPermission;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

/**
 * <p>
 * RoleEntitypermissionService
 * </p>
 *
 * @author migo
 * @since 2021/9/6
 */
@Service
public class RoleEntityPermissionService extends ServiceImpl<RoleEntityPermissionMapper, RoleEntityPermission> implements IRoleEntityPermissionService {

    @Override
    public RoleEntityPermission getUserPermission(String entityName, UUID userid, AccessRightValue access) {
        return super.getBaseMapper().getUserPermission(entityName, userid, access.value());
    }

    @Override
    public List<RoleEntityPermission> getUserPermissions(String entityName, UUID userid) {
        return super.getBaseMapper().getUserPermissions(entityName, userid);
    }

    @Override
    public List<RoleEntityPermission> getRolePermissions(List<UUID> entityIds, List<UUID> roleIds, AccessRightValue access) {
        return super.getBaseMapper().getRolePermissions(entityIds, roleIds, access.value());
    }
}
